local sk__weiwu = fk.CreateSkill {

  name = "sk__weiwu",

  tags = {  },

}



sk__weiwu:addEffect(fk.Damaged, {
  name = "sk__weiwu",
  anim_type = "masochism",
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:drawCards(2, sk__weiwu.name)
    if data.card and room:getCardArea(data.card) == Card.Processing and
      room:askForSkillInvoke(player, sk__weiwu.name, nil, "#sk__weiwu-invoke:::"..data.card:toLogString()) then
      local cards = data.card:isVirtual() and data.card.subcards or {data.card.id}
      table.insertTable(cards, table.filter(room.discard_pile, function (id)
        return Fk:getCardById(id).trueName == data.card.trueName
      end))
      room:moveCardTo(cards, Card.PlayerHand, player, fk.ReasonJustMove, sk__weiwu.name, nil, true, player)
    end
  end,
})

return sk__weiwu